<template>
	<el-dialog :title="titleMap[mode]" v-model="visible" :width="1200" destroy-on-close @closed="$emit('closed')" :align-center="true">
        <el-container>
            <el-main>
                <div style="height:400px;overflow:auto">
                    <sc-form-table ref="table" v-model="process_data" :addTemplate="process" placeholder="暂无数据" hideAdd hideDelete>
                        <el-table-column prop="order_no" label="版单编号" align="center">
                            <template #default="scope">
                                <div>
                                    {{scope.row.order_no}}
                                </div>
                            </template>
                        </el-table-column>
                        <el-table-column prop="process_title" label="一级工序" align="center">
                            <template #default="scope">
                                <div>
                                    {{scope.row.process_title}}
                                </div>
                            </template>
                        </el-table-column>
                        <el-table-column prop="two_process_title" label="二级工序" align="center">
                            <template #default="scope">
                                <div>
                                    {{scope.row.two_process_title}}
                                </div>
                            </template>
                        </el-table-column>
                        <el-table-column prop="date" label="报工时间" align="center">
                            <template #default="scope">
                                <div>
                                    {{scope.row.date}}
                                </div>
                            </template>
                        </el-table-column>
                        <el-table-column prop="num" label="报工数量" align="center">
                            <template #default="scope">
                                <div>
                                    {{scope.row.num}}
                                </div>
                            </template>
                        </el-table-column>
                    </sc-form-table>
                </div>
            </el-main>
            <el-footer>
                <div style="display: flex;justify-content: end;">
                    <el-button @click="visible=false" >取 消</el-button>
                </div>
            </el-footer>
        </el-container>
	</el-dialog>
</template>

<script>
	export default {
		emits: ['success', 'closed'],
		data() {
			return {
				mode: "add",
				titleMap: {
					add: '添加客户',
					edit: '编辑客户',
					show: '详情'
				},
				visible: false,
                process_data:[]
			}
		},
		mounted() {
		},
		methods: {
			//显示
			open(mode='add'){
				this.mode = mode;
				this.visible = true;
				return this
			},
			//表单提交方法
			submit(){
                this.visible = false;
			},
			//表单注入数据
			async setData(data){
                var res = await this.$API.develop.edition.templateCountingDetail.get({id:data.id});
                console.log('res :>> ', res);
                this.process_data = res.data
			},
		}
	}
</script>

<style lang="scss">
.el-form-item--default{
    align-items: center;
}
</style>
